//package com.topscomm.mpm.service.impl;
//
//import com.topscomm.basic.BasicEntity;
//import com.topscomm.basic.exception.ServiceException;
//import com.topscomm.basic.util.SQLAdapter;
//import com.topscomm.cbo.pojo.*;
//import com.topscomm.mpm.pojo.MpmProjectChangeEntity;
//import com.topscomm.mpm.pojo.MpmProjectCustomerEntity;
//import com.topscomm.mpm.pojo.MpmProjectEntity;
//import com.topscomm.mpm.service.IMpmProjectCustomerService;
//import com.topscomm.pub.util.ConvertUtil;
//import com.topscomm.pub.util.StringBufferProxy;
//import oracle.sql.BLOB;
//import org.apache.ibatis.session.ExecutorType;
//import org.apache.ibatis.session.SqlSession;
//import org.mybatis.spring.SqlSessionTemplate;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.annotation.Scope;
//import org.springframework.stereotype.Service;
//import org.springframework.transaction.annotation.Transactional;
//
//import javax.annotation.Resource;
//import java.io.InputStream;
//import java.util.*;
//import java.util.stream.Collectors;
//
///**
// * @description:迁移数据到LTC中
// * @author: chengengwei
// * @date: 2021-10-26
// * @modify:
// */
//@Service(value = "migrateDataToLTCService")
//@Scope(value = "singleton")
//public class MigrateDataToLTCService {
//
//    @Resource(name = "sqlSessionTemplate")
//    private SqlSessionTemplate sqlSessionTemplate;
//
//    @Resource(name = "LTCSqlSessionTemplate")
//    private SqlSessionTemplate LTCSqlSessionTemplate;
//
//    @Autowired
//    private IMpmProjectCustomerService mpmProjectCustomerService;
//
//    private String spellSQLOfBigNum(List<String> fileidList, String id) {
//        if (fileidList.size() == 0) {
//            return " 1 != 1 ";
//        }
//        StringBufferProxy whereSql = new StringBufferProxy();
//        whereSql.appendSingle(" {0} in ( ", id);
//        for (int i = 0; i < fileidList.size(); i++) {
//            if (i % 999 == 0 && i > 0) {
//                whereSql = whereSql.substring(0, whereSql.length() - 1);
//                whereSql.appendSingle(" ) or {0} in ( '{1}',", id, fileidList.get(i));
//            } else {
//                whereSql.appendSingle("'{0}',", fileidList.get(i));
//            }
//        }
//        whereSql = whereSql.substring(0, whereSql.length() - 1);
//        whereSql.appendSingle(" )");
//        return whereSql.toString();
//    }
//
//    private void settOldNewIdByTable(String tableName) {
//        Map<String, Object> paramMap = new HashMap<>();
//        paramMap.put("tablename", tableName);
//        List<Map<String, Object>> oldmaps = this.sqlSessionTemplate.selectList("migrateData.getIdAndCodeByTableName", paramMap);
//        List<Map<String, Object>> newmaps = this.LTCSqlSessionTemplate.selectList("migrateData.getIdAndCodeByTableName", paramMap);
//        List<Map<String, Object>> insertBatchList = new ArrayList<>();
//        Map<String, List<Map<String, Object>>> oldMapsGroup = oldmaps.stream().collect(Collectors.groupingBy(item -> item.get("code").toString()));
//        Map<String, List<Map<String, Object>>> newMapsGroup = newmaps.stream().collect(Collectors.groupingBy(item -> item.get("code").toString()));
//        for (Map.Entry<String, List<Map<String, Object>>> entry : oldMapsGroup.entrySet()) {
//            if (newMapsGroup.containsKey(entry.getKey())) {
//                List<Map<String, Object>> maps = newMapsGroup.get(entry.getKey());
//                Map<String, Object> itemMap = new HashMap<>();
//                itemMap.put("tablename", tableName);
//                itemMap.put("oldid", entry.getValue().get(0).get("id").toString());
//                itemMap.put("newid", maps.get(0).get("id").toString());
//                insertBatchList.add(itemMap);
//            }
//        }
//        this.insertBatch(this.sqlSessionTemplate, insertBatchList, "migrateData.insertOldNewIdRecord");
//    }
//
//    private void insertBatch(SqlSessionTemplate sqlSessionTemplate, List insertBatchList, String selectName) {
//        SqlSession batchSqlSessionTemplate = sqlSessionTemplate.getSqlSessionFactory().openSession(ExecutorType.BATCH, false);
//        try {
//            for (int i = 0; i < insertBatchList.size(); i++) {
//                batchSqlSessionTemplate.insert(selectName, insertBatchList.get(i));
//                if (i > 0 && i % 1000 == 0 || i == insertBatchList.size() - 1) {
//                    batchSqlSessionTemplate.commit();
//                }
//            }
//        } catch (Exception e) {
//            throw new ServiceException(e);
//        } finally {
//            batchSqlSessionTemplate.close();
//        }
//    }
//
//    private void dealFlowdiagram(List<Map<String, Object>> list) {
//        try {
//            for (Map<String, Object> map : list) {
//                if (map.get("flowdiagram") == null) {
//                    continue;
//                }
//                BLOB flowdiagram = (BLOB) map.get("flowdiagram");
//                byte[] temp = new byte[(int)flowdiagram.length()];
//                InputStream in = flowdiagram.getBinaryStream();
//                while (true) {
//                    int read = in.read(temp);
//                    if (read == -1) {
//                        break;
//                    }
//                }
//                String strDiagram = new String(temp);
//                strDiagram = strDiagram.replaceAll("value':'2", "value':'92")
//                        .replaceAll("rect2", "rect92")
//                        .replaceAll("path2", "path92");
//                map.put("flowdiagram", strDiagram.getBytes("UTF-8"));
//            }
//        } catch (Exception e) {
//            e.printStackTrace();
//            throw new ServiceException(e.getMessage());
//        }
//    }
//
//    /**
//     * @description:设置销售项目立项和复盘表DeptCommonCode字段值
//     * @author: chengengwei
//     * @date: 2021-10-28
//     * @modify:
//     */
//    @Transactional(rollbackFor = Exception.class, transactionManager = "transactionManager")
//    public void setDeptCommonCodeValue() {
//        this.sqlSessionTemplate.update("migrateData.updateProjectDeptCommonCode", null);
//        this.sqlSessionTemplate.update("migrateData.updateReviewDeptCommonCode", null);
//        System.out.println("DeptCommonCode更新成功");
//    }
//
//    /**
//     * @description:插入新老id关系中间表记录
//     * @author: chengengwei
//     * @date: 2021-11-01
//     * @modify:
//     */
//    @Transactional(rollbackFor = Exception.class, transactionManager = "transactionManager")
//    public void setOldNewIdRelation() {
//        Map<String, Object> paramMap = new HashMap<>();
//        paramMap.put("tablename", "old_new_id");
//        this.sqlSessionTemplate.delete("migrateData.deleteByWhere", paramMap);
//        this.settOldNewIdByTable(CboUserEntity.tableName);
//        this.settOldNewIdByTable(CboDeptEntity.tableName);
//        this.settOldNewIdByTable(CboOrgEntity.tableName);
//        System.out.println("id中间表更新成功");
//    }
//
//    /**
//     * @description:用两种方式更新id
//     * @author: chengengwei
//     * @date: 2021-11-02
//     * @modify:
//     */
//    @Transactional(rollbackFor = Exception.class, transactionManager = "transactionManager")
//    public void dealOldNewIdByRelation() {
//        Map<String, Object> paramMap = new HashMap<>();
//        paramMap.put("tablename", "UpdateIdConfig");
//        // 所有需要更新的表的字段，以及id类型（LTC的id还是前缀加9）
//        List<Map<String, Object>> updateIdConfigList = this.sqlSessionTemplate.selectList("migrateData.selectAllByWhere", paramMap);
//        // 先在本地更新id
//        for (Map<String, Object> map : updateIdConfigList) {
//            paramMap.clear();
//            paramMap.put("targetTableName", ConvertUtil.convertToString(map.get("targettablename")));
//            paramMap.put("updateField", ConvertUtil.convertToString(map.get("updatefield")));
//            paramMap.put("whereSql", ConvertUtil.convertToString(map.get("whereSql")));
//            paramMap.put("flagTableName", ConvertUtil.convertToString(map.get("flagtablename")));
//            if ("1".equals(ConvertUtil.convertToString(map.get("type")))) {
//                this.sqlSessionTemplate.update("migrateData.updateUserDeptOrgId", paramMap);
//            } else if ("2".equals(ConvertUtil.convertToString(map.get("type")))) {
//                this.sqlSessionTemplate.update("migrateData.updateIdByPlus9", paramMap);
//            } else if ("3".equals(ConvertUtil.convertToString(map.get("type")))) {
//                this.sqlSessionTemplate.update("migrateData.executeUpdate", paramMap);
//            }
//        }
//        //单独处理CboApprovalFlow的deptids字段
//        paramMap.clear();
//        paramMap.put("tablename", "old_new_id");
//        paramMap.put("whereSql", "tablename = 'CboDept'");
//        List<Map<String, Object>> deptList = this.sqlSessionTemplate.selectList("migrateData.selectAllByWhere", paramMap);
//        Map<String, List<Map<String, Object>>> deptListMap = deptList.stream().collect(Collectors.groupingBy(item -> ConvertUtil.convertToString(item.get("oldid"))));
//        paramMap.clear();
//        paramMap.put("tablename", "CboApprovalFlow");
//        paramMap.put("whereSql", "deptids is not null");
//        List<Map<String, Object>> approvalUpdateList = this.sqlSessionTemplate.selectList("migrateData.selectAllByWhere", paramMap);
//        for (Map<String, Object> map : approvalUpdateList) {
//            String[] deptids = ConvertUtil.convertToString(map.get("deptids")).split(";");
//            String newdeptids = Arrays.stream(deptids).map(oldid -> {
//                if (deptListMap.containsKey(oldid)) {
//                    return ConvertUtil.convertToString(deptListMap.get(oldid).get(0).get("newid"));
//                }
//                return oldid;
//            }).collect(Collectors.joining(";"));
//            paramMap.clear();
//            paramMap.put("deptids", newdeptids);
//            paramMap.put("id", map.get("id"));
//            this.sqlSessionTemplate.update("migrateData.updateApprovalDeptids", paramMap);
//        }
//        System.out.println("MPM中的id更新成功");
//    }
//
//    /**
//     * @description:插入需要程序迁移的数据
//     * @author: chengengwei
//     * @date: 2021-11-02
//     * @modify:
//     */
//    @Transactional(rollbackFor = Exception.class, transactionManager = "LTCTransactionManager")
//    public void insertRecordToLTC() throws Exception {
//        Map<String, Object> paramMap = new HashMap<>();
//        String tablename, whereSql, idtochar = SQLAdapter.toChar("id");
//        paramMap.put("tablename", "MoveRecordInfo");
//        // 需要用程序插入LTC中的表的记录
//        List<Map<String, Object>> moveRecordInfoList = this.sqlSessionTemplate.selectList("migrateData.selectAllByWhere", paramMap);
//        for (Map<String, Object> map : moveRecordInfoList) {
//            tablename = ConvertUtil.convertToString(map.get("tablename"));
//            whereSql = ConvertUtil.convertToString(map.get("wheresql"));
//            paramMap.clear();
//            paramMap.put("tablename", tablename);
//            paramMap.put("whereSql", "instr(" + idtochar + ", '9') = 1");
//            // 删除LTC中之前迁移的数据
//            this.LTCSqlSessionTemplate.delete("migrateData.deleteByWhere", paramMap);
//            paramMap.put("whereSql", whereSql);
//            //  先查询再批量插入
//            List<Map<String, Object>> moveRecordList = this.sqlSessionTemplate.selectList("migrateData.selectAllByWhere", paramMap);
//            // 处理审批流图中的id
//            if (CboApprovalFlowEntity.tableName.equals(tablename)) {
//                this.dealFlowdiagram(moveRecordList);
//            } else if (CboModuleEntity.tableName.equals(tablename)) {
//                //处理模块配置的code
//                moveRecordList = moveRecordList.stream().map(item -> {
//                    String code = ConvertUtil.convertToString(item.get("code"));
//                    if (code.startsWith("9904")) {
//                        item.put("code", "9907" + code.substring(4));
//                    }
//                    return item;
//                }).collect(Collectors.toList());
//            }
//            this.insertBatch(this.LTCSqlSessionTemplate, moveRecordList, "migrateData.insert" + tablename);
//        }
//        System.out.println("数据同步到LTC成功");
//    }
//
//    /**
//     * @description:处理系统编码
//     * @author: chengengwei
//     * @date: 2021-11-02
//     * @modify:
//     */
//    @Transactional(rollbackFor = Exception.class, transactionManager = "LTCTransactionManager")
//    public void dealCboItems() {
//        Map<String, Object> paramMap = new HashMap<>();
//        paramMap.put("tablename", "cboitems");
//        paramMap.put("whereSql", "code is not null and code != ' '");
//        List<Map<String, Object>> oldmaps = this.sqlSessionTemplate.selectList("migrateData.getAllDataByTableName", paramMap);
//        List<Map<String, Object>> newmaps = this.LTCSqlSessionTemplate.selectList("migrateData.getAllDataByTableName", paramMap);
//        Map<String, List<Map<String, Object>>> oldMapsGroup = oldmaps.stream().collect(Collectors.groupingBy(item -> ConvertUtil.convertToString(item.get("code"))));
//        Map<String, List<Map<String, Object>>> newMapsGroup = newmaps.stream().collect(Collectors.groupingBy(item -> ConvertUtil.convertToString(item.get("code"))));
//        List<CboItemsEntity> insertBatchItemsList = new ArrayList<>();
//        List<CboItemDetailsEntity> insertBatchDetailsList = new ArrayList<>();
//        // 获取MPM中特有的编码
//        for (String key : oldMapsGroup.keySet()) {
//            if (!newMapsGroup.keySet().contains(key)) {
//                insertBatchItemsList.add((CboItemsEntity) new CboItemsEntity().convertFromMap(oldMapsGroup.get(key).get(0)));
//            }
//        }
//        List<String> ids = insertBatchItemsList.stream().map(item -> ConvertUtil.convertToString(item.getId()))
//                .collect(Collectors.toList());
//        paramMap.clear();
//        paramMap.put("tablename", "cboitemdetails");
//        paramMap.put("whereSql", spellSQLOfBigNum(ids, "itemid"));
//        // 获取编码值
//        List<Map<String, Object>> detailList = this.sqlSessionTemplate.selectList("migrateData.getAllDataByTableName", paramMap);
//        for (Map<String, Object> map : detailList) {
//            insertBatchDetailsList.add((CboItemDetailsEntity) new CboItemDetailsEntity().convertFromMap(map));
//        }
//        //将编码id、编码值id、编码值itemid前面加9防重
//        insertBatchItemsList.forEach(item -> item.setId(ConvertUtil.convertToLong("9" + item.getId())));
//        insertBatchDetailsList.forEach(item -> {
//            item.setId(ConvertUtil.convertToLong("9" + item.getId()));
//            item.setItemid(ConvertUtil.convertToLong("9" + item.getItemid()));
//        });
//        // 单独处理CboApprovalFlowCategory编码值
//        paramMap.clear();
//        paramMap.put("tablename", "cboitems");
//        paramMap.put("whereSql", "code = 'CboApprovalFlowCategory'");
//        oldmaps = this.sqlSessionTemplate.selectList("migrateData.getAllDataByTableName", paramMap);
//        newmaps = this.LTCSqlSessionTemplate.selectList("migrateData.getAllDataByTableName", paramMap);
//        paramMap.clear();
//        paramMap.put("tablename", "cboitemdetails");
//        paramMap.put("whereSql", "itemid = '" + oldmaps.get(0).get("id").toString() + "'");
//        oldmaps = this.sqlSessionTemplate.selectList("migrateData.getAllDataByTableName", paramMap);
//        for (Map<String, Object> map : oldmaps) {
//            map.put("id", "9" + map.get("id").toString());
//            map.put("itemid", newmaps.get(0).get("id").toString());
//            insertBatchDetailsList.add((CboItemDetailsEntity) new CboItemDetailsEntity().convertFromMap(map));
//        }
//        // 删除LTC中之前导入的记录
//        paramMap.clear();
//        paramMap.put("tablename", "cboitems");
//        paramMap.put("whereSql", spellSQLOfBigNum(insertBatchItemsList.stream().map(item ->
//                ConvertUtil.convertToString(item.getId())).collect(Collectors.toList()), "id"));
//        this.LTCSqlSessionTemplate.delete("migrateData.deleteByWhere", paramMap);
//        paramMap.clear();
//        paramMap.put("tablename", "cboitemdetails");
//        paramMap.put("whereSql", spellSQLOfBigNum(insertBatchDetailsList.stream().map(item ->
//                ConvertUtil.convertToString(item.getId())).collect(Collectors.toList()), "id"));
//        this.LTCSqlSessionTemplate.delete("migrateData.deleteByWhere", paramMap);
//        // 将编码和编码明细批量导入LTC
//        this.insertBatch(this.LTCSqlSessionTemplate, insertBatchItemsList, "migrateData.insertCboItems");
//        this.insertBatch(this.LTCSqlSessionTemplate, insertBatchDetailsList, "migrateData.insertCboItemDetails");
//        System.out.println("编码表更新成功");
//    }
//
//    /**
//     * @description:处理系统参数
//     * @author: chengengwei
//     * @date: 2021-11-03
//     * @modify:
//     */
//    @Transactional(rollbackFor = Exception.class, transactionManager = "LTCTransactionManager")
//    public void dealSysParam() {
//        Map<String, Object> paramMap = new HashMap<>();
//        paramMap.put("tablename", CboSysParamEntity.tableName);
//        List<Map<String, Object>> oldParams = this.sqlSessionTemplate.selectList("migrateData.getAllDataByTableName", paramMap);
//        List<Map<String, Object>> newParams = this.LTCSqlSessionTemplate.selectList("migrateData.getAllDataByTableName", paramMap);
//        Map<String, List<Map<String, Object>>> newParamsGroup = newParams.stream().collect(Collectors.groupingBy(item -> ConvertUtil.convertToString(item.get("code"))));
//        List<Map<String, Object>> insertBatchList = new ArrayList<>();
//        for (Map<String, Object> map : oldParams) {
//            if (!newParamsGroup.containsKey(ConvertUtil.convertToString(map.get("code")))) {
//                insertBatchList.add(map);
//            }
//        }
//        this.insertBatch(this.LTCSqlSessionTemplate, insertBatchList, "migrateData.insertCboSysParam");
//        System.out.println("系统参数更新成功");
//    }
//
//    /**
//     * @description:处理客户信息历史数据
//     * @author: chengengwei
//     * @date: 2021-11-03
//     * @modify:
//     */
//    @Transactional(rollbackFor = Exception.class, transactionManager = "transactionManager")
//    public void dealCustomerInfo() {
//        Map<String, Object> paramMap = new HashMap<>();
//        paramMap.put("tablename", MpmProjectCustomerEntity.tableName);
//        this.sqlSessionTemplate.delete("migrateData.deleteByWhere", paramMap);
//        paramMap.clear();
//        List<BasicEntity> insertBatchList = new ArrayList<>();
//        // 查询所有项目关联的线索或机会点code
//        List<Map<String, Object>> codes = this.sqlSessionTemplate.selectList("migrateData.getLeadOrChanceAndProjectCode", null);
//        List<Map<String, Object>> leadcodesList = codes.stream().filter(item -> "1".equals(ConvertUtil.convertToString(item.get("projectsource")))).collect(Collectors.toList());
//        List<Map<String, Object>> chancecodesList = codes.stream().filter(item -> "2".equals(ConvertUtil.convertToString(item.get("projectsource")))).collect(Collectors.toList());
//        for (Map<String, Object> map : leadcodesList) {
//            String[] leadcodes = ConvertUtil.convertToString(map.get("chanceclue")).split(",");
//            for (String s : leadcodes) {
//                paramMap.put("code", s);
//                List<Map<String, Object>> leadinfo = this.LTCSqlSessionTemplate.selectList("migrateData.getLeadCustomerInfo", paramMap);
//                if (!leadinfo.isEmpty()) {
//                    Map<String, Object> info = leadinfo.get(0);
//                    MpmProjectCustomerEntity customerEntity = new MpmProjectCustomerEntity();
//                    customerEntity.setClientcode(ConvertUtil.convertToString(info.get("clientcode")));
//                    customerEntity.setClientname(ConvertUtil.convertToString(info.get("clientname")));
//                    customerEntity.setClientdept(ConvertUtil.convertToString(info.get("clientdept")));
//                    customerEntity.setCustomersourcetype(ConvertUtil.convertToString(info.get("customersourcetype")));
//                    customerEntity.setSourcetype(MpmProjectEntity.tableName);
//                    customerEntity.setSourceid(ConvertUtil.convertToLong(map.get("id")));
//                    customerEntity.setProjectcode(ConvertUtil.convertToString(map.get("projectcode")));
//                    insertBatchList.add(customerEntity);
//                }
//            }
//        }
//        for (Map<String, Object> map : chancecodesList) {
//            String[] chancecodes = ConvertUtil.convertToString(map.get("chanceclue")).split(",");
//            for (String s : chancecodes) {
//                paramMap.put("code", s);
//                List<Map<String, Object>> chanceinfo = this.LTCSqlSessionTemplate.selectList("migrateData.getChanceCustomerInfo", paramMap);
//                if (!chanceinfo.isEmpty()) {
//                    Map<String, Object> info = chanceinfo.get(0);
//                    MpmProjectCustomerEntity customerEntity = new MpmProjectCustomerEntity();
//                    customerEntity.setClientcode(ConvertUtil.convertToString(info.get("clientcode")));
//                    customerEntity.setClientname(ConvertUtil.convertToString(info.get("clientname")));
//                    customerEntity.setClientdept(ConvertUtil.convertToString(info.get("clientdept")));
//                    customerEntity.setCustomersourcetype(ConvertUtil.convertToString(info.get("customersourcetype")));
//                    customerEntity.setSourcetype(MpmProjectEntity.tableName);
//                    customerEntity.setSourceid(ConvertUtil.convertToLong(map.get("id")));
//                    customerEntity.setProjectcode(ConvertUtil.convertToString(map.get("projectcode")));
//                    insertBatchList.add(customerEntity);
//                }
//            }
//        }
//        // 查询所有项目变更关联的线索或机会点code
//        codes = this.sqlSessionTemplate.selectList("migrateData.getLeadOrChanceAndChanceProjectCode", null);
//        leadcodesList = codes.stream().filter(item -> "1".equals(ConvertUtil.convertToString(item.get("projectsource")))).collect(Collectors.toList());
//        chancecodesList = codes.stream().filter(item -> "2".equals(ConvertUtil.convertToString(item.get("projectsource")))).collect(Collectors.toList());
//        for (Map<String, Object> map : leadcodesList) {
//            String[] leadcodes = ConvertUtil.convertToString(map.get("chanceclue")).split(",");
//            for (String s : leadcodes) {
//                paramMap.put("code", s);
//                List<Map<String, Object>> leadinfo = this.LTCSqlSessionTemplate.selectList("migrateData.getLeadCustomerInfo", paramMap);
//                if (!leadinfo.isEmpty()) {
//                    Map<String, Object> info = leadinfo.get(0);
//                    MpmProjectCustomerEntity customerEntity = new MpmProjectCustomerEntity();
//                    customerEntity.setClientcode(ConvertUtil.convertToString(info.get("clientcode")));
//                    customerEntity.setClientname(ConvertUtil.convertToString(info.get("clientname")));
//                    customerEntity.setClientdept(ConvertUtil.convertToString(info.get("clientdept")));
//                    customerEntity.setCustomersourcetype(ConvertUtil.convertToString(info.get("customersourcetype")));
//                    customerEntity.setSourcetype(MpmProjectChangeEntity.tableName);
//                    customerEntity.setSourceid(ConvertUtil.convertToLong(map.get("id")));
//                    customerEntity.setProjectcode(ConvertUtil.convertToString(map.get("projectcode")));
//                    insertBatchList.add(customerEntity);
//                }
//            }
//        }
//        for (Map<String, Object> map : chancecodesList) {
//            String[] chancecodes = ConvertUtil.convertToString(map.get("chanceclue")).split(",");
//            for (String s : chancecodes) {
//                paramMap.put("code", s);
//                List<Map<String, Object>> chanceinfo = this.LTCSqlSessionTemplate.selectList("migrateData.getChanceCustomerInfo", paramMap);
//                if (!chanceinfo.isEmpty()) {
//                    Map<String, Object> info = chanceinfo.get(0);
//                    MpmProjectCustomerEntity customerEntity = new MpmProjectCustomerEntity();
//                    customerEntity.setClientcode(ConvertUtil.convertToString(info.get("clientcode")));
//                    customerEntity.setClientname(ConvertUtil.convertToString(info.get("clientname")));
//                    customerEntity.setClientdept(ConvertUtil.convertToString(info.get("clientdept")));
//                    customerEntity.setCustomersourcetype(ConvertUtil.convertToString(info.get("customersourcetype")));
//                    customerEntity.setSourcetype(MpmProjectChangeEntity.tableName);
//                    customerEntity.setSourceid(ConvertUtil.convertToLong(map.get("id")));
//                    customerEntity.setProjectcode(ConvertUtil.convertToString(map.get("projectcode")));
//                    insertBatchList.add(customerEntity);
//                }
//            }
//        }
//        this.mpmProjectCustomerService.insertBatch(insertBatchList);
//    }
//}
